/**
 * 
 */
package br.org.bertol.mestrado.engine.optimisation;

import java.util.Comparator;

/**
 * @author contaqualquer
 */
public class OrdenateSpacialPosition<U extends Unit> implements Comparator<U> {

    @Override
    public int compare(U left, U right) {

        if (left.getSpacialPosition() < right.getSpacialPosition())
            return -1;
        if (left.getSpacialPosition() > right.getSpacialPosition())
            return 1;

        return 0;
    }

}
